package com.handsome.职责链模式;

/**
 * @author niechun
 * @date 2023/3/27 21:10
 */
public class DepartmentApproveHandler extends ApproveHandler{


    public DepartmentApproveHandler(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if (request.getPrice()<=5000){
            System.out.println(super.getName()+"正在处理请求编号："+request.getId());
            return;
        }
        //处理不了则交给下一个handler处理
        getHandler().processRequest(request);
    }
}
